﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Light.Framework.Model;

namespace Light.Framework.Contract
{
    /// <summary>
    /// 字典数据访问类
    /// </summary>
    public interface IDictionaryComponent
    {
        /// <summary>
        /// 根据代码获取
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        T GetByCode<T>(string code) where T : class;

        /// <summary>
        /// 根据名称获取
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        T GetByName<T>(string name) where T : class;

        /// <summary>
        /// 获取所有
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        IList<T> Get<T>() where T : class;

        /// <summary>
        /// 根据查询参数获取
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="args"></param>
        /// <returns></returns>
        IList<T> Get<T>(SearchArgs args) where T : class;

        /// <summary>
        /// 获取省份下的城市
        /// </summary>
        /// <param name="provinceName"></param>
        /// <returns></returns>
        IList<City> GetCity(string provinceName);

        /// <summary>
        /// 获取城市下的区域
        /// </summary>
        /// <param name="cityCode">城市代码</param>
        /// <returns></returns>
        IList<District> GetDistrict(string cityCode);

        /// <summary>
        /// 获取城市下的区域
        /// </summary>
        /// <param name="cityName">城市名称</param>
        /// <returns></returns>
        IList<District> GetDistrictByCityName(string cityName);

    }
}
